// 设备组中英文对照常量
const DEVICE_GROUPS = [
  { groupId: "103", name: "APs_Host", name_cn: "AP设备_主机" },
  { groupId: "102", name: "Access Switches_Host", name_cn: "接入交换机_主机" },
  { groupId: "100", name: "Aggregation Switches_Host", name_cn: "汇聚交换机_主机" },
  { groupId: "19", name: "Applications", name_cn: "应用程序" },
  { groupId: "108", name: "Cameras_Host", name_cn: "摄像头_主机" },
  { groupId: "99", name: "Core Switches_Host", name_cn: "核心交换机_主机" },
  { groupId: "20", name: "Databases", name_cn: "数据库" },
  { groupId: "5", name: "Discovered hosts", name_cn: "已发现主机" },
  { groupId: "104", name: "Firewalls_Host", name_cn: "防火墙_主机" },
  { groupId: "101", name: "HUBs_Host", name_cn: "集线器_主机" },
  { groupId: "7", name: "Hypervisors", name_cn: "虚拟机管理程序" },
  { groupId: "109", name: "IDS Systems_Host", name_cn: "入侵检测系统_主机" },
  { groupId: "110", name: "IPS Systems_Host", name_cn: "入侵防御系统_主机" },
  { groupId: "2", name: "Linux servers", name_cn: "Linux服务器" },
  { groupId: "46", name: "Routers", name_cn: "路由器" },
  { groupId: "98", name: "Routers_Host", name_cn: "路由器_主机" },
  { groupId: "105", name: "Security Boundary Devices_Host", name_cn: "安全边界设备_主机" },
  { groupId: "106", name: "Servers_Host", name_cn: "服务器_主机" },
  { groupId: "107", name: "Terminals_Host", name_cn: "终端_主机" },
  { groupId: "28", name: "Test", name_cn: "测试" },
  { groupId: "6", name: "Virtual machines", name_cn: "虚拟机" },
  { groupId: "4", name: "Zabbix servers", name_cn: "Zabbix服务器" }
]

//1. 按名称获取中文显示
export function getNameCnByName (name) {
  const group = DEVICE_GROUPS.find(item => item.name === name)
  return group ? group.name_cn : name
}